#include<stdio.h>
#include<unistd.h>

int main()
{
    int i = 0;
    char buf[128] = {'\0'};
    const char* lable = "|/-\\";
    for (i = 0; i < 100; ++i)
    {
        buf[i] = '=';
        if (i < 99)
            buf[i + 1] = '>';
        printf("[%-100s][%3d%%][%c]\r", buf,i + 1, lable[i % 4]);
        usleep(50000);
        fflush(stdout);
    }
    printf("\n");
    return 0;
}                                                                                                                                                                                           
